import React from 'react'
import './index.less'
const RadioSelect = (props) => {
    const { value, onChange, list = [] } = props
    return <div className='RadioSelect_box'>
        {list.map((val, index) => {
            const { label, key } = val
            return <div onClick={() => {
                onChange(key)
            }} className={value === key ? 'RadioSelect_button_box RadioSelect_button_checked' : 'RadioSelect_button_box'}>
                {label}
                {value !== key && (list.length !== index + 1) && <div className='RadioSelect_button_liner'></div>}
            </div>
        })}
    </div>
}
export default RadioSelect
